﻿using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
namespace INTEX.DataBase.Tools
{
    public partial class INTEXDBC
    {
        public DataSet QueryZABED(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM ZABED WHERE  ROWNUM<2 ";
                    break;
                case 1:
                    or1.CommandText = "SELECT * FROM ZABED WHERE ZABMANDANT=:ZABMANDANT AND ZABNR=:ZABNR"; ;
                    or1.Parameters.Add("ZABMANDANT", OracleType.NVarChar).Value = dwData["ZABMANDANT"].ToString();
                    or1.Parameters.Add("ZABNR", OracleType.NVarChar).Value = dwData["ZABNR"].ToString();
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "ZABED";
            Return = Result;
            return Return;
        }
    }
}
